{{if $login_type=="box"}}{{include file="header.tpl"}}{{/if}}
<script type="text/javascript">
$(function(){
	$('#btnlogin').click(function(){
		if($('#username').val()!="" && $('#password').val()!=""){
			var param = $('#form1').serialize();
			//window.location.href="index.php?{{$TIN_CTL}}=user&{{$TIN_ACT}}=ChkLogin&"+param;
			$.jBox.tip('正在验证...','loading');
			$.post("index.php?{{$TIN_CTL}}=user&{{$TIN_ACT}}=ChkLogin",param,function(res){
				if(res.code=='success'){
					$.jBox.tip("登录成功。");
					window.open(res.tourl,"_top");
				}else{
					$.jBox.tip(res.msg);
				}
			},"json");			
		}else{
			$.jBox.alert('请填写用户名或密码','登录');
		}
		return false;
	});
	$('#chkcode').click(function(){
		$(this).attr("src","res/vcode.php?rnd="+Math.random());
	});
});
</script>
<h2>用户登录：</h2>
<form id="form1" name="form1" method="post" action="index.php?{{$TIN_CTL}}=user">
<input type="hidden" name="tourl" id="tourl" value="{{$smarty.request.tourl|urlencode}}" />
用户名：<input type="text" name="username" id="username" />
密码：<input type="password" name="password" id="password" />
验证码：<input type="text" name="checkCode" id="checkCode" />
<img id="chkcode" src="res/vcode.php" style="cursor:pointer" width="60" height="25">
<input type="submit" name="btnlogin" id="btnlogin" value="确定登录" />
</form>
{{if $login_type=="box"}}{{include file="footer.tpl"}}{{/if}}